package com.wordplat.quickstart.xutils;

import com.wordplat.quickstart.xutils.common.Callback;
import com.wordplat.quickstart.xutils.image.ImageOptions;
import ohos.agp.components.Image;
import ohos.media.image.PixelMap;

import java.io.File;

/**
 * Created by wyouflf on 15/6/17.
 * 图片绑定接口
 *
 * @since 2021-05-09
 */
public interface ImageManager {
    /**
     * bind
     *
     * @param view
     * @param url
     */
    void bind(Image view, String url);

    /**
     * bind
     *
     * @param view
     * @param url
     * @param options
     */
    void bind(Image view, String url, ImageOptions options);

    /**
     * bind
     *
     * @param view
     * @param url
     * @param callback
     */
    void bind(Image view, String url, Callback.CommonCallback<PixelMap> callback);

    /**
     * bind
     *
     * @param view
     * @param url
     * @param options
     * @param callback
     */
    void bind(Image view, String url, ImageOptions options, Callback.CommonCallback<PixelMap> callback);

    /**
     * loadDrawable
     *
     * @param url
     * @param options
     * @param callback
     * @return Cancelable
     */
    Callback.Cancelable loadDrawable(String url, ImageOptions options, Callback.CommonCallback<PixelMap> callback);

    /**
     * loadFile
     *
     * @param url
     * @param options
     * @param callback
     * @return Cancelable
     */
    Callback.Cancelable loadFile(String url, ImageOptions options, Callback.CacheCallback<File> callback);

    /**
     * clearMemCache
     */
    void clearMemCache();

    /**
     * clearCacheFiles
     */
    void clearCacheFiles();
}
